package org.wu.acw.server.controller;

import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.wu.framework.web.spring.EasyController;
import org.springframework.web.bind.annotation.*;
import org.wu.framework.web.response.Result;
import jakarta.annotation.Resource;
import org.wu.acw.server.domain.model.acw.single.table.operation.log.AcwSingleTableOperationLog;
import org.wu.acw.server.application.command.acw.single.table.operation.log.AcwSingleTableOperationLogRemoveCommand;
import org.wu.acw.server.application.command.acw.single.table.operation.log.AcwSingleTableOperationLogStoryCommand;
import org.wu.acw.server.application.command.acw.single.table.operation.log.AcwSingleTableOperationLogUpdateCommand;
import org.wu.acw.server.application.command.acw.single.table.operation.log.AcwSingleTableOperationLogQueryListCommand;
import org.wu.acw.server.application.command.acw.single.table.operation.log.AcwSingleTableOperationLogQueryOneCommand;
import org.wu.acw.server.application.AcwSingleTableOperationLogApplication;
import org.wu.acw.server.application.dto.AcwSingleTableOperationLogDTO;
import java.util.List;
import org.wu.framework.lazy.orm.database.lambda.domain.LazyPage;
/**
 * describe 单表操作日志 
 *
 * @author Jia wei Wu
 * @date 2024/04/29 09:55 上午
 * @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyController 
 **/
@Tag(name = "单表操作日志提供者")
@EasyController("/acw/single/table/operation/log")
public class AcwSingleTableOperationLogProvider  {

    @Resource
    private AcwSingleTableOperationLogApplication acwSingleTableOperationLogApplication;

    /**
     * describe 新增单表操作日志
     *
     * @param acwSingleTableOperationLogStoryCommand 新增单表操作日志     
     * @return {@link Result<AcwSingleTableOperationLog>} 单表操作日志新增后领域对象     
     
     * @author Jia wei Wu
     * @date 2024/04/29 09:55 上午
     **/

    @Operation(summary = "新增单表操作日志")
    @PostMapping("/story")
    public Result<AcwSingleTableOperationLog> story(@RequestBody AcwSingleTableOperationLogStoryCommand acwSingleTableOperationLogStoryCommand){
        return acwSingleTableOperationLogApplication.story(acwSingleTableOperationLogStoryCommand);
    }
    /**
     * describe 批量新增单表操作日志
     *
     * @param acwSingleTableOperationLogStoryCommandList 批量新增单表操作日志     
     * @return {@link Result<List<AcwSingleTableOperationLog>>} 单表操作日志新增后领域对象集合     
     
     * @author Jia wei Wu
     * @date 2024/04/29 09:55 上午
     **/

    @Operation(summary = "批量新增单表操作日志")
    @PostMapping("/batchStory")
    public Result<List<AcwSingleTableOperationLog>> batchStory(@RequestBody List<AcwSingleTableOperationLogStoryCommand> acwSingleTableOperationLogStoryCommandList){
        return acwSingleTableOperationLogApplication.batchStory(acwSingleTableOperationLogStoryCommandList);
    }
    /**
     * describe 更新单表操作日志
     *
     * @param acwSingleTableOperationLogUpdateCommand 更新单表操作日志     
     * @return {@link Result<AcwSingleTableOperationLog>} 单表操作日志领域对象     
     
     * @author Jia wei Wu
     * @date 2024/04/29 09:55 上午
     **/

    @Operation(summary = "更新单表操作日志")
    @PutMapping("/updateOne")
    public Result<AcwSingleTableOperationLog> updateOne(@RequestBody AcwSingleTableOperationLogUpdateCommand acwSingleTableOperationLogUpdateCommand){
        return acwSingleTableOperationLogApplication.updateOne(acwSingleTableOperationLogUpdateCommand);
    }
    /**
     * describe 查询单个单表操作日志
     *
     * @param acwSingleTableOperationLogQueryOneCommand 查询单个单表操作日志     
     * @return {@link Result<AcwSingleTableOperationLogDTO>} 单表操作日志DTO对象     
     
     * @author Jia wei Wu
     * @date 2024/04/29 09:55 上午
     **/

    @Operation(summary = "查询单个单表操作日志")
    @GetMapping("/findOne")
    public Result<AcwSingleTableOperationLogDTO> findOne(@ModelAttribute AcwSingleTableOperationLogQueryOneCommand acwSingleTableOperationLogQueryOneCommand){
        return acwSingleTableOperationLogApplication.findOne(acwSingleTableOperationLogQueryOneCommand);
    }
    /**
     * describe 查询多个单表操作日志
     *
     * @param acwSingleTableOperationLogQueryListCommand 查询多个单表操作日志     
     * @return {@link Result<List<AcwSingleTableOperationLogDTO>>} 单表操作日志DTO对象     
     
     * @author Jia wei Wu
     * @date 2024/04/29 09:55 上午
     **/

    @Operation(summary = "查询多个单表操作日志")
    @GetMapping("/findList")
    public Result<List<AcwSingleTableOperationLogDTO>> findList(@ModelAttribute AcwSingleTableOperationLogQueryListCommand acwSingleTableOperationLogQueryListCommand){
        return acwSingleTableOperationLogApplication.findList(acwSingleTableOperationLogQueryListCommand);
    }
    /**
     * describe 分页查询多个单表操作日志
     *
     * @param acwSingleTableOperationLogQueryListCommand 分页查询多个单表操作日志     
     * @return {@link Result<LazyPage<AcwSingleTableOperationLogDTO>>} 分页单表操作日志DTO对象     
     
     * @author Jia wei Wu
     * @date 2024/04/29 09:55 上午
     **/

    @Operation(summary = "分页查询多个单表操作日志")
    @GetMapping("/findPage")
    public Result<LazyPage<AcwSingleTableOperationLogDTO>> findPage(@Parameter(description ="分页大小") @RequestParam(defaultValue = "10", value = "size") int size,
                           @Parameter(description ="当前页数") @RequestParam(defaultValue = "1", value = "current") int current,@ModelAttribute AcwSingleTableOperationLogQueryListCommand acwSingleTableOperationLogQueryListCommand){
        return acwSingleTableOperationLogApplication.findPage(size,current,acwSingleTableOperationLogQueryListCommand);
    }
    /**
     * describe 删除单表操作日志
     *
     * @param acwSingleTableOperationLogRemoveCommand 删除单表操作日志     
     * @return {@link Result<AcwSingleTableOperationLog>} 单表操作日志     
     
     * @author Jia wei Wu
     * @date 2024/04/29 09:55 上午
     **/

    @Operation(summary = "删除单表操作日志")
    @DeleteMapping("/remove")
    public Result<AcwSingleTableOperationLog> remove(@ModelAttribute AcwSingleTableOperationLogRemoveCommand acwSingleTableOperationLogRemoveCommand){
        return acwSingleTableOperationLogApplication.remove(acwSingleTableOperationLogRemoveCommand);
    }
}